powered by
node_instrumental tags instrumental variables given an exposure and outcome. ggdag_instrumental plots all instrumental variables. See dagitty::instrumentalVariables() for details.
node_instrumental
ggdag_instrumental
dagitty::instrumentalVariables()
node_instrumental(.dag, exposure = NULL, outcome = NULL, ...)ggdag_instrumental( .tdy_dag, exposure = NULL, outcome = NULL, ..., node_size = 16, text_size = 3.88, label_size = text_size, text_col = "white", label_col = text_col, node = TRUE, stylized = FALSE, text = TRUE, use_labels = NULL )
ggdag_instrumental( .tdy_dag, exposure = NULL, outcome = NULL, ..., node_size = 16, text_size = 3.88, label_size = text_size, text_col = "white", label_col = text_col, node = TRUE, stylized = FALSE, text = TRUE, use_labels = NULL )
a tidy_dagitty with an instrumental column for instrumental variables or a ggplot
tidy_dagitty
instrumental
ggplot
input graph, an object of class tidy_dagitty or dagitty
dagitty
character vector of length 1, name of exposure variable. Default is NULL, in which case it will check the input DAG for exposure.
NULL
additional arguments passed to tidy_dagitty()
tidy_dagitty()
size of DAG node
size of DAG text
size of label text
color of DAG text
color of label text
logical. Should nodes be included in the DAG?
logical. Should DAG nodes be stylized? If so, use geom_dag_nodes and if not use geom_dag_point
geom_dag_nodes
geom_dag_point
logical. Should text be included in the DAG?
a string. Variable to use for geom_dag_repel_label(). Default is NULL.
geom_dag_repel_label()
library(dagitty) node_instrumental(dagitty("dag{ i->x->y; x<->y }"), "x", "y") ggdag_instrumental(dagitty("dag{ i->x->y; i2->x->y; x<->y }"), "x", "y")
Run the code above in your browser using DataLab